# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=vpcs
pkgver=0.8
pkgrel=1
pkgdesc="Simple virtual PC simulator"
url="https://sourceforge.net/projects/vpcs/"
arch="aarch64 x86 x86_64"
license="BSD-2-Clause"
makedepends="linux-headers bsd-compat-headers"
source="https://github.com/GNS3/${pkgname}/archive/v${pkgver}beta1.tar.gz
	musl-fixes.patch
	vpcs_alpine_aarch64.patch"
builddir="$srcdir"/$pkgname-${pkgver}beta1/src

build() {
	cd "$builddir"
	./mk.sh $(getconf LONG_BIT)
}

check() {
	cd "$builddir"
	./vpcs -v || test $? = 2
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir/usr/bin"
	install -Dm755 ${pkgname} ${pkgdir}/usr/bin/${pkgname}
}

sha512sums="9d090613c3d59c9952d89739eb4fbdcf67f45f26e19e2999d94f82b5f026cc263265f33eea7db56d6fae8c59d4b954ee184d4bfe80d7dd22ae08c5d6f9090486  v0.8beta1.tar.gz
b0ffc373e436e93a959b3d0ce30de9415cad1e761aae27444d1c99ac585cab9676d939143248d55334e1e0cefcbfa2ae75943fd74eec2221d7292f349aa334c7  musl-fixes.patch
a4b35efb5f9ab1ff3c34e0dbb38b42e78222c695310b08e9019959adead3a2bf439b955e9c636648418310065fa866d49649ee2da204c5e66e87cdcf6a50d9c7  vpcs_alpine_aarch64.patch"
